function [er] = loadGroupData(stratsGroup,index,rankGroupLength,rankGroupNum,m,n)
%LOADGROUPDATA Summary of this function goes here
%   Detailed explanation goes here
expectedReturnLength=50;
totalStratsNum=size(stratsGroup,1);
eachGroupStratsNum=floor(totalStratsNum/rankGroupNum);
%
periodLength=size(stratsGroup,2)
para=periodLength-rankGroupLength


%get those strats in the GROUP(m,n)
if m < rankGroupNum
    tempStratsIndex=index((m-1)*eachGroupStratsNum+1:m*eachGroupStratsNum,n);
else if m == rankGroupNum
        tempStratsIndex=index((m-1)*eachGroupStratsNum+1:totalStratsNum,n);
    end
end



%tranverse tempStratsIndex
cumER=0;
for i=1:length(tempStratsIndex)
    singleNV=stratsGroup(tempStratsIndex(i),para+n-expectedReturnLength+1:n+para); % net value historical data of single strategy k
    singleER=calculateER(singleNV);
    cumER=cumER+singleER;
end

%
er=cumER/eachGroupStratsNum;


    function [er] =calculateER(netValueSeries)
        % this method needed to be analyzed in advance
        er=netValueSeries(length(netValueSeries))/netValueSeries(1)-1
        
    end


end


